/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.warehouse.entity;

import org.hibernate.validator.constraints.Length;
import com.thinkgem.jeesite.modules.warehouse.entity.Vendor;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkgem.jeesite.modules.sys.entity.Office;
import com.thinkgem.jeesite.modules.sys.entity.User;

import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.common.utils.excel.annotation.ExcelField;

/**
 * deviceEntity
 * @author qrg
 * @version 2017-08-09
 */
public class Device extends DataEntity<Device> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// name
	private String model;		// model
	private String sn;		// sn
	private String price;		// price
	private String currency;		// currency
	private String unit;		// unit
	private Vendor vendor;		// vendor_id
	private Date purchaseDate;		// purchase_date
	private String serviceLifeMonth;		// service_life_month
	private String deviceStatus;		// device_status
	private Office office;		// office_id
	private User user;		// device_user_id
	
	public Device() {
		super();
	}

	public Device(String id){
		super(id);
	}

	@Length(min=0, max=300, message="name长度必须介于 0 和 300 之间")
	@ExcelField(title = "Name",align = 0, sort = 10)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=100, message="model长度必须介于 0 和 100 之间")
	@ExcelField(title = "Model",align = 0, sort = 10)
	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}
	
	@Length(min=0, max=100, message="sn长度必须介于 0 和 100 之间")
	@ExcelField(title = "SN",align = 0, sort = 10)
	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}
	
	@ExcelField(title = "Price",align = 0, sort = 10)
	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}
	
	@Length(min=0, max=60, message="currency长度必须介于 0 和 60 之间")
	@ExcelField(title = "Currency",align = 0, sort = 10)
	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}
	
	@Length(min=0, max=60, message="unit长度必须介于 0 和 60 之间")
	@ExcelField(title = "Unit",align = 0, sort = 20)
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}
	
	@ExcelField(title = "Vendor",align = 0, sort = 30,fieldType = Vendor.class,value="vendor.name")
	public Vendor getVendor() {
		return vendor;
	}

	public void setVendor(Vendor vendor) {
		this.vendor = vendor;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title = "PurchaseDate",align = 0, sort = 40)
	public Date getPurchaseDate() {
		return purchaseDate;
	}

	public void setPurchaseDate(Date purchaseDate) {
		this.purchaseDate = purchaseDate;
	}
	
	@ExcelField(title = "ServiceLife",align = 0, sort = 50)
	public String getServiceLifeMonth() {
		return serviceLifeMonth;
	}

	public void setServiceLifeMonth(String serviceLifeMonth) {
		this.serviceLifeMonth = serviceLifeMonth;
	}
	
	@Length(min=0, max=60, message="device_status长度必须介于 0 和 60 之间")
	@ExcelField(title = "Status",align = 0, sort = 60, dictType="vendorType")
	public String getDeviceStatus() {
		return deviceStatus;
	}

	public void setDeviceStatus(String deviceStatus) {
		this.deviceStatus = deviceStatus;
	}
	
	@ExcelField(title = "Office",align = 0, sort = 70)
	public Office getOffice() {
		return office;
	}

	public void setOffice(Office office) {
		this.office = office;
	}
	
	@ExcelField(title = "User",align = 0, sort = 80)
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
}